<?php
/***************************************************************************
 *   copyright : (C) 2009 Udrea Cristian
 *   site : http://code.google.com/p/testauction-php
 ***************************************************************************/

/***************************************************************************
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as 
 *   published by the Free Software Foundation; either version 2 of the
 *   License, or (at your option) any later version. Although none of the
 *   code may be sold. If you have been sold this script, get a refund.
 ***************************************************************************/
define('APP_ROOT', '../');
//###############################################
include(APP_ROOT.'include/session.php');
$pageTitle = "Pagina De Administrare";
$script = array();
if (isset($_GET['logout'])) {
	$session->logout();
	header('Location: index.php');
}

if($session->logged_in && $session->isAdmin()) {
	$content = "main.php";
}
else {
	//Just to be on the safe(r) side
	$content = "login.php";
	$session->logout();
}
require_once('include/template.php');
?>
